<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title><%= title %></title>
    <% include ../partial/meta %>
    <link rel="stylesheet" href="/app/static/css/frozen.css">
    <link rel="stylesheet" href="/app/static/css/client.css">
    <link rel="stylesheet" href="/app/static/css/jq.css">
</head>
<body style ="background: #F0F0F0">
    <div class ="community">
        <ul class="ui-row">
            <li class="ui-col ui-col-50">
                <img src="<%= community.community.cover %>?w=640&q=60" alt="">
            </li>
            <li class="ui-col ui-col-50">
                <div class ="community-desc">
                    <p><strong><%= community.community.name %></strong></p>
                    <p name ="item">位置：<%= community.community.location %></p>
                    <p name ="item">面积：<%= community.community.area %>㎡</p>
                    <p name ="item">绿化率：<%= community.community.virescence %>%</p>
                    <p name ="item">年份：<%= community.community.decade %></p>
                </div>
            </li>
        </ul>
    </div>
    <div class ="community-detail">
        <p>小区附近交通信息</p>
        <div class ="room-bg room-about">
            <p><%= community.community.trafficInfos %></p>
            <div class="more"><span>更多</span></div>
        </div>
    </div>
    <div class ="community-detail">
        <p>小区附近生活信息</p>
        <div class ="room-bg room-about">

            <p><%= community.community.lifeServices %></p>
            <div class="more"><span>更多</span></div>
        </div>
    </div>
    <div class ="community-detail">
        <p>小区简介</p>
        <div class ="room-bg room-about">
            <p><%= community.community.desc %></p>
            <div class="more"><span>更多</span></div>
        </div>
    </div>
    <div class ="community-detail">
        <p>本小区的其他房源</p>
        <div class ="team-list">
            <ul class="ui-row">
            <% 
                for(var i = 0; i < houseList.length && i < 1; i++) {
            %>
                <li class="ui-col ui-col-50">
                    <img src="<%= houseList[i].cover %>?w=640&q=60" alt="">
                </li>
                <li class="ui-col ui-col-50">
                    <p><strong><%= houseList[i].community %></strong></p>
                    <p class="brand-color">¥<%= houseList[i].singleRentFloor %> 元<small>起</small></p>
                    <p><div class="ui-nowrap ui-whitespace ui-txt-muted"><%= houseList[i].region %> | <%= houseList[i].roomNum %>室<%= houseList[i].hallNum %>厅<%= houseList[i].toiletNum %>卫 | <%= houseList[i].area %>㎡</div></p>

                    <!-- <p class ="check"><img src="/app/static/img/business.png" alt="">经纪人带看</p>
                    <p class ="check"><img src="/app/static/img/check.png" alt="">房妈妈验房保证</p> -->

                    <% 
                        if(houseList[i].seemode) {
                    %>
                    <p class ="check reset"><img src="/app/static/img/business.png" alt=""><%= houseList[i].seemode %></p>
                    <%
                        } else {
                    %>
                    <p class ="check reset"><img src="/app/static/img/business.png" alt="">不提供带看</p>
                    <%
                        } 
                    %>
                    <% 
                        if(houseList[i].check) {
                    %>
                    <p class ="check reset"><img src="/app/static/img/check.png" alt="">房妈妈验房保证</p>
                    <%
                        } else {
                    %>
                    <p class ="check reset"><img src="/app/static/img/check.png" alt="">房妈妈未验房</p>
                    <%
                        } 
                    %>
                </li>
                <div class="more"><span>更多</span></div>
            <%
                } 
            %>
            </ul>
        </div>
    </div>
    <div class ="community-detail surrounding">
        <p>附近小区</p>
        <div class ="room-bg room-about">
            <ul class="ui-row">
            <% 
                for(var i = 0; i < surrounding.communities.length && i < 3; i++) {
            %>
                <li class="ui-col ui-col-33">
                    <img src="<%= surrounding.communities[i].cover %>?w=640&q=60" alt="">
                    <p style ="padding-top:6px;font-size:14px"><%= surrounding.communities[i].name %></p>
                </li>
            <%
                } 
            %>
            </ul>
            <div class="more" style="margin-right:12px"><span>更多</span></div>
        </div>
    </div>
    <script type="text/javascript" src ="/app/static/js/zepto.min.js"></script>
    <script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
    <script src ="/app/static/js/customalert.js"></script>
    <script>
    $(function() {
        function alert(str) {
            $.customalert({
                content: str
            })
        }
        $(".more").on('click', function(event) {
            alert('<a href="http://a.app.qq.com/o/simple.jsp?pkgname=com.fangmm.housemother">点击下载房妈妈App，查看更多信息</a>')
        });


        wx.config({
            debug: false,
            appId: '<%= jsapiSignature.appId %>',
            timestamp: "<%= jsapiSignature.timestamp %>",
            nonceStr: '<%= jsapiSignature.noncestr %>',
            signature: '<%= jsapiSignature.signature %>',
            jsApiList: [
                'onMenuShareTimeline',
                'onMenuShareAppMessage'
            ]
        });


        wx.ready(function(){

            wx.onMenuShareTimeline({
                title: '我发现了一间很棒的房源，快来合租吧~',
                link: '',
                imgUrl: '',
                success: function () {

                },
                cancel: function () {
                    alert("您取消了分享链接！");
                }
            });

            wx.onMenuShareAppMessage({
                title: '我发现了一间很棒的房源，快来合租吧~',
                link: '',
                desc: '我给您分享了一套房源哦~快来看看吧~ <%= community.community.name %> <%= community.community.location %>',
                imgUrl: '',
                type: 'link',
                dataUrl: '',
                success: function () {
                },
                cancel: function () {
                    alert("您取消了分享链接！");
                }

            });

        })

        wx.error(function(res){
            var url = 'http://m.fangmm.com/app/client/clear';
            $.get(url, function(data) {
                if(200 == data.code) {
                    location.reload();
                }
            }, 'json')
        })
    })
    </script>
    <% include ../partial/analyse %>
</body>

</html>
